#ifndef DSPSIMULATOR_LDNDW_H
#define DSPSIMULATOR_LDNDW_H

#include <dspSimulator/targetMachine/dspInstruction.h>

class LDNDW : public DspInstruction {
public:
    explicit LDNDW(u64 address = 0, u64 baseCycle = 0) :
            DspInstruction("LDNDW", address, baseCycle, 4) {}

    ~LDNDW() override = default;

    LDNDW(const LDNDW &) = default;

    bool checkCondition(std::shared_ptr<DspMachine> dspMachine) override;

    void loadInstIRIntoJit(llvm::LLVMContext *llvmContext, llvm::Module *module,
                           std::shared_ptr<llvm::IRBuilder<>> irBuilder) override;

    std::shared_ptr<Instruction> decode(std::shared_ptr<InstInfo> instInfo, u64 baseCycle) override;

    void executeCustom(std::shared_ptr<TargetMachine> targetMachine, ExecutePhase executePhase) override;

    std::string toString() const override;

    std::shared_ptr<DspInstruction> clone() override;

private:
    u32 m_visitMemAddr = 0;
    std::vector<u8> m_dataLo;
    std::vector<u8> m_dataHi;
};

#endif //DSPSIMULATOR_LDNDW_H